home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Oberon⁄F™ 1.2 / Preinstalled version / Obx / Docu / Actions (.txt) next >
Encoding:
Oberon Document  |  1996-02-15  |  2.8 KB  |  39 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Helvetica
  16. Helvetica
  17. Helvetica
  18. DevCommanders.StdViewDesc
  19. DevCommanders.ViewDesc
  20. StdLinks.LinkDesc
  21. StdCmds.OpenDoc('Obx/Mod/Actions')
  22. Helvetica
  23. Oberon by Example: ObxActions
  24. This example demonstrates how background tasks can be implemented using actions. An action is an object which performs some action later when the system is idle, i.e. between user interactions. An action can be scheduled to execute as soon as possible, or after some time has passed. Upon execution, an action may re-schedule itself for a later point in time. In this way, an action can operate as a background task, getting computation time whenever the system is idle. This strategy is called cooperative multitasking. For this to work, an action may not do massive computations, because this would reduce the responsiveness of the system. Longer calculations need to be broken down into less time consuming pieces. This is demonstrated by an algorithm which calculates prime numbers up to a given maximum, as a background task. An action is used to perform the stepwise calculation. Every newly found prime number is written to a text. This text remains invisible as long as the calculation goes on. The action checks whether it has reached the maximum set by the user. If this is not yet the case, it re-schedules itself for further execution. Otherwise, it opens a window with the list of prime numbers, i.e. a text view on the created text.
  25.  "StdCmds.OpenAuxDialog('Obx/Rsrc/PrimeDlg', 'Prime Calculation')"
  26. ObxActions
  27. sources
  28. TextControllers.StdCtrlDesc
  29. TextControllers.ControllerDesc
  30. Containers.ControllerDesc
  31. Controllers.ControllerDesc
  32. TextRulers.StdRulerDesc
  33. TextRulers.RulerDesc
  34. TextRulers.StdStyleDesc
  35. TextRulers.StyleDesc
  36. TextRulers.AttributesDesc
  37. Helvetica
  38. Documents.ControllerDesc
  39.